<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        *{
            margin: 0;
            padding:0;
        }
        .out{
            width: 500px;
            perspective: 1000px;
            -webkit-perspective: 1000px;
        }
        .inner{
            font-size: 32px;
            width: 100px;
            margin: 50px auto;
            transform-style: preserve-3d;
            -webkit-transform-style: preserve-3d;
            transform: rotateX(-40deg) rotateY(32deg) rotateZ(0deg);
        }
        .inner div{
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: rgba(255,0,0,0.3);
            border: 1px solid rgba(0,0,0,0.5);
            color: white;
            text-align: center;
            line-height: 100px;
        }
        .fir{
            transform: translateZ(50px);
            -webkit-transform:translateZ(50px);
        }
        .fou{
            transform:rotateY(90deg) translateZ(50px);
            -webkit-transform:rotateY(90deg) translateZ(50px);
        }
        .six{
            transform:rotateY(-180deg) translateZ(50px);
            -webkit-transform:rotateY(-180deg) translateZ(50px);
        }
        .thr{
            transform:rotateY(-90deg) translateZ(50px);
            -webkit-transform:rotateY(-90deg) translateZ(50px);
        }
        .fiv{
            transform:rotateX(90deg) translateZ(50px);
            -webkit-transform:rotateX(90deg) translateZ(50px);
        }
        .sec{
            transform:rotateX(-90deg) translateZ(50px);
            -webkit-transform:rotateX(-90deg) translateZ(50px);
        }
    </style>
</head>
<body>
  <div class="out">
      <div class="inner">
          <!-- 垂直的四个边-->
          <div class="fir">1</div>
          <div class="fou">4</div>
          <div class="six">6</div>
          <div class="thr">3</div>
          <!-- 水平的两个边-->
          <div class="fiv">5</div>
          <div class="sec">2</div>

      </div>
  </div>
</body>
</html>